﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Entity;

public partial class Admin_Pages_SizeAdd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["login"] != null)
        {

        }
        else
        {
            Response.Redirect("../Login.aspx");
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        SizeUI size = new SizeUI();

        int result = size.Add(txtSize.Text.Trim(), float.Parse(txtPrice.Text.Trim()));
        if (result > 0)
        {
            Response.Write("<script>alert('Insert successful'); window.location='../Pages/SizeList.aspx';</script>");
        }
        else
        {
            Response.Write("<script>alert('Insert fail'); window.location='../Pages/SizeList.aspx';</script>");
        }
    }
}
